#include "connectdialog.h"


ConnectDialog::ConnectDialog(){
		NF_LoadTiledBg(	"bgconnect",	
					"bgconnect",		
					256,		
					256
					);
		NF_LoadSpriteGfx("loading", 2, 32, 32);//fname, id slot gfx 0-255, width, height
		NF_LoadSpritePal("loading", 2);
		NF_VramSpritePal(1, 2, 2);//screen,ramslot,vramslot
		NF_VramSpriteGfx(1, 2, 9, true);//screen,ramslot,vramslot,frame
		hidden = false;
		
}

ConnectDialog::~ConnectDialog(){
	NF_UnloadTiledBg( "bgconnect");
	//NF_DeleteSprite( 1,9);
	NF_FreeSpriteGfx( 1,9);
	NF_UnloadSpriteGfx(2);
	NF_UnloadSpritePal(2);
}


void ConnectDialog::show(){
	hidden=false;
	NF_CreateTiledBg(	1,		// screen
				0,		// layer 0-3
				"bgconnect"	// name
						);
	NF_CreateSprite(1, //screen
			 9, //sprite id
			 9, //gfx
			 2, //palette
			 110, 100);//x,y
	//NF_SpriteFrame(1, 9, 1);
	setSpriteAnim(1,9,8,10);
	
	NF_SpriteOamSet(0);
	NF_SpriteOamSet(1);
	
	oamUpdate(&oamMain);
	oamUpdate(&oamSub);
}

void ConnectDialog::hide(){
	hidden=true;
	delteSpriteAnim(1,9);
	
	NF_DeleteTiledBg( 1,0);
	NF_DeleteSprite( 1,9);
	
	//NF_HideBg(1,0);
	NF_SpriteOamSet(0);
	NF_SpriteOamSet(1);
	swiWaitForVBlank();
	oamUpdate(&oamMain);
	oamUpdate(&oamSub);

}

void ConnectDialog::run(void * retdata){

}